home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / answers / aix-faq / part2 < prev    next >
Encoding:
Text File  |  1993-06-14  |  74.1 KB  |  2,012 lines

  1. Path: senator-bedfellow.mit.edu!enterpoop.mit.edu!usc!cs.utexas.edu!mavrick!basto@cactus.org
  2. From: basto@cactus.org (Luis Basto)
  3. Newsgroups: comp.unix.aix,news.answers,comp.answers
  4. Subject: AIX Frequently Asked Questions (Part 2 of 2)
  5. Summary: This posting contains a list of Frequently Asked Questions 
  6.          and their answers about AIX, IBM's version of Unix.
  7. Keywords: AIX RS/6000 questions answers
  8. Message-ID: <1439@mavrick.UUCP>
  9. Date: 15 Jun 93 06:09:54 GMT
  10. Expires: 15 Jul 93 01:23:45 GMT
  11. Sender: luis@mavrick.UUCP
  12. Reply-To: basto@cactus.org (Luis Basto)
  13. Followup-To: comp.unix.aix
  14. Lines: 1993
  15. Approved: news-answers-request@MIT.Edu
  16. Supersedes: <1433@mavrick.UUCP>
  17. Xref: senator-bedfellow.mit.edu comp.unix.aix:26285 news.answers:9416 comp.answers:1002
  18.  
  19. Archive-name: aix-faq/part2
  20. Last-modified: June 15, 1993
  21. Version: 2.33
  22.  
  23.  
  24. Version: $Id: aix.faq,v 2.33 93/06/15 basto $
  25.  
  26. Frequently Asked Questions to AIX 3.x and IBM RS/6000
  27. _____________________________________________________
  28.  
  29. 1.40: How can I add new man pages to the system?
  30. From: horst@faui63.informatik.uni-erlangen.de (Horst Luehrsen)
  31.  
  32. Put the man pages in /usr/man, eg.  /usr/man/man1/tcsh.1 for the tcsh
  33. man page.  Unter AIX 3.1.10, there is a shell script /usr/lib/makewhatis
  34. which can be used to update the makewhatis-database /usr/man/whatis so
  35. apropos and whatis know about the added manpages. /usr/lib/makewhatis
  36. should be available on all 3.2 versions.
  37.  
  38.  
  39. 1.41: How much paging space do I need?
  40.  
  41. The rule of thumb is paging space = 2 times physical memory. For example,
  42. if your system has 48 MB of RAM, you want to allocate 96 MB for paging.
  43. However, this is application dependent. If you do software development,
  44. especially large projects, then you should consider this rule. But if your
  45. system has 512 MB memory, you may not need 1 Gig of paging. Use 'lsps -a'
  46. during typical system loading to determine if your system is thrashing.
  47. Never allocate less paging space than physical memory or performance 
  48. will suffer seriously.
  49.  
  50.  
  51. 1.42: How can I make an exact duplicate of a tape over the network?
  52.  
  53. The challenge here is not to have to create a temporary file (disk space
  54. limitation) and work across heterogenous networks.
  55.  
  56. This script might work:
  57.  
  58. LOCAL=/dev/tape_dev
  59. REMOTE=/dev/tape_dev
  60. dd if=$LOCAL ibs=64k obs=512 | rsh remote_host dd ibs=512 obs=64k of=$REMOTE
  61.  
  62.  
  63. From: pack@acd.ucar.edu (Daniel Packman)
  64.  
  65. Daniel provides the following perl script to convert from the known
  66. world's function codes to AIX for compatibility.
  67.  
  68. #!/bin/perl
  69. # Wrapper to convert input rmt requests to
  70. # AIX 3.2 ioctl numbers.  We pass on all commands we don't understand
  71. # I0 MTWEOF -> I10  STWEOF write and end-of-file record
  72. # I1 MTFSF  -> I11  STFSF  forward space file
  73. # I2 MTBSF  -> I12  STRSF  reverse space file
  74. # I3 MTFSR  -> I13  STFSR  forward space record
  75. # I4 MTBSR  -> I14  STRSR  reverse space record
  76. # I5 MTREW  -> I6   STREW  rewind
  77. # I6 MTOFFL -> I5   STOFFL rewind and unload tape
  78. # I7 MTNOP  -> I0   (no-op? should ignore following count)
  79. # I8 MTRETEN-> I8   STRETEN retension tape, leave at load point
  80. # I9 MTERASE-> I7   STERASE erase tape, leave at load point
  81. #I10 MTEOM (position to end of media ... no ibm equivalent?)
  82. #I11 MTNBSF  (backward space file to BOF ... no ibm equivalent?)
  83. @iocs = (10,11,12,13,14,6,5,0,8,7);
  84. open(RMT,"|/usr/sbin/rmt") || die "Can't open pipe to rmt\n";
  85. select(RMT);
  86. $| = 1;
  87. while (<STDIN>) {
  88.   s/(^I)(\d$)/I$iocs[$2]/;
  89.   exit 0 if $_ =~ /^[Qq]/;
  90.   print RMT $_ ; }
  91. exit 0;
  92.  
  93.  
  94. 1.43: How do I find a file name from the inode number?
  95.  
  96. From: svpillay@berlioz.crs4.it (Kanthan Pillay)
  97.  
  98.       find /mntpoint -xdev -inum nnnn -print
  99.  
  100.  
  101. 1.44: How do I set up postscript accounting?
  102.  
  103. From: taluskie@utpapa.ph.utexas.edu (Vince Taluskie)
  104.  
  105. The following program to configure postscript page accounting was 
  106. originally written by Ephraim Vider.  It acts as a backend wrapper 
  107. which logs accounting information in /etc/qconfig. It can be ftp'd 
  108. from utpapa.ph.utexas.edu in /pub/aix/psacct.tar.Z.
  109.  
  110. To get this program running compile it with
  111.  
  112. cc  pswrap.c -o pswrap -lqb
  113.  
  114. and then make this program suid root with
  115.  
  116. chown root pswrap
  117. chmod u+s pswrap
  118.  
  119. If this step is not done, the printer will hang.
  120.  
  121. Then start up SMIT and go to :
  122.  
  123. Spooler
  124.   Manage Local Printer Subsystem
  125.     Local Printer Queue Devices
  126.       Change / Show Characteristics of a Queue Device
  127.         <Select Queue>
  128.           <Select Device>
  129.  
  130. and change "BACKEND PROGRAM pathname" to the full pathname of pswrap
  131. since pswrap will now handle the backend interface with the queue.
  132.  
  133. A stream of info will be written to a logfile in /tmp (prob lp0.log)
  134. but this file is mainly used for status info and raw pagecounts.  If 
  135. the accounting data is going to the qconfig-specified acctfile, then
  136. use the 'pac' command to read it.  I prefer to have readable ascii data
  137. files instead, so just I comment out the '#define WANT_PAC' line and it
  138. will only go to the ACCTFILE specfied in pswrap.c.
  139.  
  140.  
  141. /*********    pswrap.c    ***********/
  142.  
  143. /*
  144.  compile with:   cc pswrap.c -o pswrap -lqb
  145.  (for doc on the qb library see "understanding backend routines in libqb")
  146.  
  147.  BTW:  The log_charge() function doesn't seem to do anything,
  148.        but log_pages() updates the accounting info.
  149.  
  150. Ephraim Vider, original author 
  151.  
  152. --
  153. Feb 10, 1993
  154.  
  155. You can set pswrap up to use either the accounting file specified in
  156. /etc/qconfig (which means that you need to get your data from 'pac')
  157. or you can comment out the #define WANT_PAC line and then the accounting
  158. data will only go into the ACCTFILE.
  159.  
  160. Also modified the logging to the ASCII acctfile so that it looks more
  161. readable.
  162.  
  163. Vince Talsukie, taluskie@utpapa.ph.utexas.edu
  164. */
  165.  
  166.  #include <stdio.h>
  167.  #include <string.h>
  168.  #include <ctype.h>
  169.  #include <fcntl.h>
  170.  #include <signal.h>
  171.  #include <setjmp.h>
  172.  #include <sys/wait.h>
  173.  #include <IN/backend.h>
  174.  #include <IN/standard.h>
  175.  #include "qprocs.h"
  176.  
  177.  char     *nextword (char *p);
  178.  char     *skipvalue (char *p);
  179.  
  180.  #define LOGDIR     "/tmp"
  181.  #define ACCTFILE   "/usr/adm/acct/lpr/ps-acct"
  182. /* #define WANT_PAC     1 */     /* this define will also send accounting
  183.                                  info to the acctfile specified in
  184.                  /etc/qconfig file.  If this define is 
  185.                  commented out then accounting info will
  186.                  only go to ACCTFILE  */
  187.  
  188.  
  189.  char     pcprog[] = "statusdict begin pagecount = end\n\x04";
  190.  
  191.  char     *keyw[] = {
  192.      "idle",
  193.      "busy",
  194.      "waiting",
  195.      "printing",
  196.      "initializing",
  197.      NULL
  198.  };
  199.  enum     { PS_IDLE, PS_BUSY, PS_WAIT, PS_PRINT, PS_INIT, PS_UNKNOWN };
  200.  
  201.  void     giveup();
  202.  jmp_buf  jumper;
  203.  
  204.  char     logfname[30];
  205.  FILE     *logfile, *acctfile;
  206.  
  207.  main (argc, argv)
  208.  int argc;
  209.  char     *argv[];
  210.  {
  211.      char *devname;
  212.      int  pagcnt, c;
  213.      int  pid;
  214.      int  w, status;
  215.  
  216.      if (argc < 2) {
  217.           fprintf(stderr, "Usage: psbe file\n");
  218.           exit(-1);
  219.      }
  220.      if (log_init(argv[1]) < 0) {
  221.           fprintf(stderr, "log_init failed!\n");
  222.           exit(EXITBAD);
  223.      }
  224.      sprintf(logfname, "%s/%s.log", LOGDIR, get_device_name());
  225.      if ((logfile = fopen(logfname, "a")) == NULL) {
  226.           fprintf(stderr, "Can't open logfile.\n");
  227.           exit(EXITBAD);
  228.      }
  229.  
  230.      if ((acctfile = fopen(ACCTFILE, "a")) == NULL) {
  231.      fprintf(stderr, "Can't open logfile.\n");
  232.      exit(EXITBAD);
  233.      }
  234.  
  235.      setvbuf(logfile, NULL, _IOLBF, BUFSIZ);
  236.      setvbuf(acctfile, NULL, _IOLBF, BUFSIZ);
  237.  
  238.      setvbuf(stdin, NULL, _IONBF, 0);
  239.      setvbuf(stdout, NULL, _IONBF, 0);
  240.      fprintf(logfile, "start Job no. %d, queued on %s\n", get_job_number(),
  241.                get_qdate());
  242.      log_status(WAITING);
  243.      pagcnt = getpagecnt();
  244.      log_status(RUNNING);
  245.      if ((pid = fork()) < 0) {
  246.           perror("fork");
  247.           exit(EXITBAD);
  248.      }
  249.      if (pid == 0) {
  250.           argv[0] = "piobe";
  251.           execv("/usr/lpd/piobe", argv);
  252.           perror("exec");
  253.           exit(EXITBAD);
  254.      }
  255.      while ((w = wait(&status)) != pid)
  256.           if (w == -1) {
  257.                perror("wait");
  258.                exit(EXITBAD);
  259.           }
  260.      if (WEXITSTATUS(status) != 0)
  261.           exit(WEXITSTATUS(status));
  262.      log_status(WAITING);
  263.  
  264.      if (pagcnt > 0 && (c = getpagecnt()) > 0) {
  265. #ifdef WANT_PAC 
  266.           log_pages(c - pagcnt);
  267. #endif
  268.     }
  269.  
  270.      fprintf(logfile, "end Job no. %d, queued on %s\n", get_job_number(),
  271.                get_qdate());
  272.  
  273. /* the accounting file format is 
  274.  
  275. pages_printed     user     queue_printed_on   time_queued
  276.  
  277. */
  278.  
  279.      fprintf(acctfile, "%d %35s %7s    %s \n", (c - pagcnt), get_from(), get_queue_name(), get_qdate());
  280.  
  281.      fclose(logfile);
  282.      fclose(acctfile);
  283.      exit(EXITOK);
  284.  }
  285.  
  286.  void     giveup ()
  287.  {
  288.      longjmp(jumper, 1);
  289.  }
  290.  
  291.  getpagecnt ()
  292.  {
  293.      int  pc = 0, pstat;
  294.      char buf[81];
  295.  
  296.      if (setjmp(jumper) != 0) {
  297.           fprintf(logfile, "giving up on status\n");
  298.           return (0);
  299.      }
  300.      alarm(60 * 2);
  301.      signal(SIGALRM, giveup);
  302.      do {
  303.           if (!gets(buf)) {
  304.                sleep(5);
  305.                putchar('\x14');    /* ^T returns status */
  306.                sleep(1); /* wait for answer from printer */
  307.                if (!gets(buf))
  308.                     return (0);
  309.           }
  310.           fprintf(logfile, "%s\n", buf);
  311.           if ((pstat = getstatus(buf)) == PS_WAIT) {
  312.                putchar('\x04');
  313.                sleep(1);
  314.           }
  315.      } while (pstat != PS_IDLE);
  316.      alarm(0);
  317.      while (gets(buf))
  318.           fprintf(logfile, "%s\n", buf);
  319.      printf("%s", pcprog);
  320.      sleep(1); /* wait for answer from printer */
  321.      if (!gets(buf))
  322.           return (0);
  323.      if (sscanf(buf, "%d", &pc) != 1)
  324.           return (0);
  325.      fprintf(logfile, "%d\n", pc);
  326.      return (pc);
  327.  }
  328.  
  329.  /**
  330.   ** Parser for printer status messages
  331.   **/
  332.  
  333.  getstatus (p)
  334.  char     *p;
  335.  {
  336.      char *t;
  337.      int  i;
  338.  
  339.      if ((p = strchr(p, '%')) == NULL)
  340.           return (PS_UNKNOWN);
  341.      if (strncmp(p, "%%[", 3) != 0)
  342.           return (PS_UNKNOWN);
  343.      for (p = nextword(p + 3) ; p != NULL ; p = skipvalue(p)) {
  344.           t = p;
  345.           p = strchr(p, ':');
  346.           *p++ = '\0';
  347.           p = nextword(p);
  348.           if (strcmp(t, "status") == 0)
  349.                break;
  350.      }
  351.      if (p == NULL)
  352.           return (PS_UNKNOWN);
  353.      t = p;
  354.      p = strchr(p, ' ');
  355.      if (p[-1] == ';')
  356.           p--;
  357.      *p = '\0';
  358.      for (i = 0 ; keyw[i] != NULL ; i++)
  359.           if (strcmp(t, keyw[i]) == 0)
  360.                break;
  361.      return (i);
  362.  }
  363.  
  364.  char     *nextword (p)
  365.  char     *p;
  366.  {
  367.      while (isspace(*p))
  368.           p++;
  369.      if (strncmp(p, "]%%", 3) == 0)
  370.           return (NULL);
  371.      return (p);
  372.  }
  373.  
  374.  char     *skipvalue (p)
  375.  char     *p;
  376.  {
  377.      char *t;
  378.  
  379.      while (p != NULL) {
  380.           p = strchr(p, ' ');
  381.           t = p;
  382.           p = nextword(p);
  383.           if (t[-1] == ';')
  384.                break;
  385.      }
  386.      return (p);
  387.  }
  388.  
  389.  /*********    qprocs.h    ***********/
  390.  /* functions for communication between qdaemon and the backend */
  391.  
  392.  char     *get_from();
  393.  char     *get_to();
  394.  char     *get_qdate();
  395.  char     *get_queue_name();
  396.  char     *get_device_name();
  397.  char     *get_title();
  398.  
  399.  
  400. 1.45: How do I set up pcsim, the DOS emulator?
  401.  
  402. You must have a bootable DOS diskette to install pcsim. Either DOS 3.3, 
  403. 4.x, or 5.0 will work. IBM do not officially support DOS 5.0 for pcsim
  404. but I have no problems with it. Just don't try to be fancy with the UMB 
  405. and memory manager stuff.
  406.  
  407. With a bootable DOS disk in the drive, do:
  408. $touch /u/dosdrive (this is the AIX file for DOS emulation)
  409. $pcsim -Adiskette 3 -Cdrive /u/dosdrive
  410. You would now get an A prompt. Type:
  411. A> fdisk
  412. Create the virtual C drive of whatever size you choose. Make it large 
  413. enough for your needs since you cannot enlarge it later.
  414. A> format c: /s (to format the virtual C drive)
  415. Now exit from pcsim with ESCpcsim (Esc key followed by pcsim).
  416.  
  417. Now create a simprof file. Following is a starter:
  418.  
  419. Adiskette   : 3
  420. Cdrive      :/u/dosdrive
  421. lpt1        : name of printer queue
  422. refresh     : 50
  423. dmode       : V
  424. mouse       : com1
  425.  
  426. You can now start pcsim anytime by typing pcsim. Make sure no floppies
  427. are in the drive. For further information, refer to publication
  428. SC23-2452, Personal Computer Simulator/6000 Guide and Reference.
  429.        
  430.  
  431. 1.46: How do I transfer files between AIX and DOS disks?
  432.  
  433. In one of the bos extensions are commands for transferring files between
  434. DOS diskettes and AIX. The commands are dosread, doswrite, dosdir, dosdel,
  435. and dosformat. Many users have mentioned that the mtools package from
  436. prep.ai.mit.edu is better than the native AIX programs.
  437.  
  438.  
  439. 1.47: How do I create boot diskettes for 3.2?
  440.  
  441. You need to have four formatted diskettes.
  442.  
  443. boot disk:                bosboot -d /dev/fd0 -a
  444. display disk:             mkdispdskt
  445. display extension disk:   mkextdskt
  446. Install/Maintenance disk: mkinstdskt
  447.  
  448.  
  449. 1.48: Some info about the memory management system
  450.  
  451. From: Michael Coggins (MCOG@CHVM1.VNET.IBM.COM).
  452.  
  453.   The following questions are answered in this document:
  454.   1. Does AIX use more paging space than other unix systems?
  455.   2. How much paging space do I need?
  456.   3. Why does vmstat show no free RAM pages?
  457.   4. Since vmstat shows no free RAM pages, am I out of RAM?
  458.   5. Shouldn't the "avm" and the "fre" fields from vmstat add up to
  459.      something?
  460.   6. Why does the "fre" field from vmstat sometimes show lots of free
  461.      RAM pages?
  462.   7. Is the vmstat "fre" field useful?
  463.  
  464.  
  465. 1. Does AIX use more paging space than other unix systems?
  466.  
  467. Under many scenarios, AIX requires more paging space than other unix
  468. systems.  The AIX VMM implements a technique called "early allocation of
  469. paging space".  When a page is allocated in RAM, and it is not a
  470. "client" (NFS) or a "persistant" (disk file) storage page, then it is
  471. considered a "working" storage page.  Working storage pages are commonly
  472. an application's stack, data, and any shared memory segments.  So, when
  473. a program's stack or data area is increased, and RAM is accessed, the
  474. VMM will allocate space in RAM and space on the paging device.  This
  475. means that even before RAM is exhausted, paging space is used.  This
  476. does not happen on many other unix systems, although they do keep track
  477. of total VM used.
  478.  
  479. Example 1:
  480. Workstation with 64mb RAM is running only one small application that
  481. accesses only a few small files.  Everything fits into RAM, including
  482. all accessed data.  On AIX, some paging space will already be used.  On
  483. other unix systems, paging space will be 100 percent free.  Clearly,
  484. this is an example that shows where we use more paging space than the
  485. other machines.
  486.  
  487. Example 2:
  488. Same machine as above, except we are running in an environment where
  489. many applications are running, and RAM is "overcommitted" (there is not
  490. enough RAM).  Also, in this environment, the system is running
  491. applications that are started, run, left idle, and not in constant use. 
  492. A session of FRAME running in a window, for example.  What happens is
  493. that eventually (theoretically) all applications will be paged out at
  494. least once.  On the AIX system and the other systems the total paging
  495. requirements will be the same (assuming similar malloc algorithm).  The
  496. major difference is that the AIX system allocated the paging space pages
  497. before they were actually needed, and the other systems did not allocate
  498. them until they were needed.  However, most other systems have an
  499. internal variable that gets incremented as virtual memory pages are
  500. used.  AIX does not do this.  This can cause the AIX system to run out
  501. of paging space (virtual memory), even though malloc() continues to
  502. return memory.  This "feature" allows sparse memory segments to work,
  503. but requires that all normal users of malloc() (sbrk()) know how much
  504. virtual memory will be available (actually impossible), and to handle a
  505. paging space low condition.  A big problem.  There are some pretty
  506. obvious pros and cons to both methods of doing Virtual Memory.
  507.  
  508. 2. How much paging space do I need?
  509.  
  510. Concerning the rule of thumb of having 2 times RAM for paging space:
  511. this is rather simplistic, as are most "rules of thumb".  If the machine
  512. is in a "persistant storage environment", meaning that they have a few
  513. small programs, and lots of data, they may not need even as much as 1
  514. times RAM for paging space.  For example, a 1GB database server running
  515. on a RISC System/6000 with 256MB of RAM, and only running about 50MB of
  516. "working" storage does not need 512MB of paging space, or even 256MB of
  517. paging space.  They only need the amount of paging space that will allow
  518. all their working storage to be paged out to disk.  This is because the
  519. 1GB database is mostly "persistant storage", and will require little or
  520. no paging space.  Excessive paging space may simply mean wasted disk
  521. space.  However, avoid insufficient paging space.  Tip: Don't have more
  522. than one paging space per disk.  Tip: Put lots of RAM in your System -
  523. it will use it.
  524.  
  525. 3. Why does vmstat show no free RAM pages?
  526.  
  527. AIX uses RAM as a possibly huge disk buffer.  If you read a file in the
  528. morning, that file is read into RAM, and left there.  If no other
  529. programs need that RAM, that file will be left in RAM until the machine
  530. is halted.  This means that if you need the file again, access will be
  531. quick.  If you need that RAM, the system will simply use the pages the
  532. file was using.  The pages were flushed back to disk earlier.  This
  533. means that you can get a huge speedup in disk access if you have enough
  534. RAM.  For example, a 200MB database will just ease into RAM if you have
  535. a 256MB system.
  536.  
  537. 4. Since vmstat shows no free RAM pages, am I out of RAM?
  538.  
  539. Probably not.  Since disk files will be "mapped" into RAM, if vmstat
  540. shows lots of RAM pages FREE, then you probably have too much RAM (not
  541. usual on a RISC System/6000)!
  542.  
  543. 5. Shouldn't the "avm" and the "fre" fields from vmstat add up to
  544.    something?
  545.  
  546. No.  The "avm" field tells you how much "Active Virtual Memory" AIX
  547. thinks you are using.  This will closely match the amount of paging
  548. space you are using.  This number has *ABSOLUTELY* nothing to do with
  549. the amount of RAM you are using, and does *NOT* include your mapped
  550. files (disk files). 
  551.  
  552. 6. Why does the "fre" field from vmstat sometimes show lots of free
  553.    RAM pages?
  554.  
  555. This will happen after an application that used a lot of RAM via
  556. "working" storage (not NFS storage, and not disk file or "persistent"
  557. storage) exits.  When RAM pages that were used by working storage (a
  558. program's stack and data area) are no longer needed, there is no need to
  559. leave them around.  AIX completely frees these RAM pages.  The time to
  560. access these pages versus a RAM page holding a "sync'd" mapped file is
  561. almost identical.  Therefore, there is no need to periodically "flush"
  562. RAM.
  563.  
  564. 7. Is the vmstat "fre" field useful?
  565.  
  566. The vmstat "fre" field represents the number of free page frames.  If
  567. the number is consistently small (less than 500 pages), this is normal. 
  568. If the number is consistently large (greater than 4000 pages), then you
  569. have more memory than you need in this machine.
  570.  
  571.  
  572. 1.49: unix:0 vs `hostname`:0
  573.  
  574. 1.) Is there any way to get the machine to check its local host table
  575.     first without renaming resolv.conf?
  576.  
  577. From: mcguire@selway.umt.edu (Charles J McGuire)
  578.  
  579.   Not that I know of.  Under SunOS and Ultrix you can specify, check
  580.   /etc/hosts, then NIS, then DNS.  On our AIX machines, I have a cron job
  581.   that checks the integrity of both the primary and secondary
  582.   nameservers every 5 minutes.  If they're gone, the cron pgm renames
  583.   resolv.conf.  The pgm continues to check the servers.  When they're
  584.   back, it moves resolv.conf back.  Even with this arrangement, I need
  585.   to configure two resolv.conf files that switch the order of the
  586.   primary and secondary servers if the primary goes away.  If the
  587.   primary is unavailable, queries can still take a while to time out on
  588.   the primary, before querying the secondary.  This method is not very
  589.   elegant, but it does the job.  Things are a little unstable during the
  590.   transitions depending on when the servers go away relative to when the
  591.   cron pgm runs - not to mention slight differences in clock times.
  592.  
  593. 2.) How do you tell X applications where you are if the console display 
  594.     is unix:0?
  595.  
  596. From: crow@waterloo.austin.ibm.com (David L. Crow)
  597.  
  598.   I would suggest that if you have R5, use ":<display>.<screen>".  I do
  599.   not believe that R4 clients will understand :0, so I would suggest
  600.   unix:0 for them.
  601.  
  602.   Without specifying unix or the hostname, you will get the fastest
  603.   trasport mechanism.  While currently there are only two transport
  604.   methods in the AIXwindows X server (Unix sockets and TCP sockets),
  605.   many vendors are looking at using shared memory as a transport method. 
  606.   If you use :0 (or :0.0 or :1, etc.), then you should get the best
  607.   performance regardless of the available transport methods.
  608.  
  609. 3.) Is there a significant performance penalty incurred by
  610. using `hostname`:0 as DISPLAY?
  611.  
  612.   Yes! Using unix:0, you are using Unix sockets.  These are much faster
  613.   than their TCP socket counterparts.
  614.  
  615. ____________________________________________________________________________
  616. 2.00: C/C++
  617.  
  618. Contrary to many people's belief, the C environment on the RS/6000 is
  619. not very special.  The C compiler has quite a number of options that can
  620. be used to control how it works, which "dialect" of C it compiles, how
  621. it interprets certain language constructs, etc.  InfoExplorer includes a
  622. Users' Guide and a Reference Manual.
  623.  
  624. The compiler can be invoked with either xlc to invoke it in ANSI mode
  625. and cc to invoke it in RT (i.e. IBM 6150 with AIX 2) compatible mode. 
  626. The default options for each mode are set in the /etc/xlc.cfg file, and
  627. you can actually add another stanza and create a link to the /bin/xlc
  628. executable.
  629.  
  630. The file /usr/lpp/xlc/bin/README.xlc has information about the C
  631. compiler, and the file /usr/lpp/bos/bsdport contains useful information,
  632. in particular for users used to BSD.
  633.  
  634. The file /etc/xlc.cfg also shows the symbol _IBMR2 that is predefined,
  635. and therefore can be used for #ifdef'ing RS/6000 specific code.
  636.  
  637.  
  638. 2.01: I cannot make alloca work
  639.  
  640. A famous routine, in particular in GNU context, is the allocation
  641. routine alloca().  Alloca allocates memory in such a way that it is
  642. automatically free'd when the block is exited.  Most implementations
  643. does this by adjusting the stack pointer.  Since not all C environments
  644. can support it, its use is discouraged, but it is included in the xlc
  645. compiler.  In order to make the compiler aware that you intend to use
  646. alloca, you must put the line
  647.  
  648. #pragma alloca
  649.  
  650. before any other statements in the C source module(s) where alloca is
  651. called.  If you don't do this, xlc will not recognize alloca as anything
  652. special, and you will get errors during linking.
  653.  
  654. For AIX 3.2, it may be easier to use the -ma flag.
  655.  
  656.  
  657. 2.02: How do I compile my BSD programs?
  658.  
  659. The file /usr/lpp/bos/bsdport contains information on how to port
  660. programs written for BSD to AIX 3.1.  The contents of this file can
  661. actually be very useful for others as well.
  662.  
  663. A quick cc command for most "standard" BSD programs is:
  664.   
  665.   $ cc -D_BSD -D_BSD_INCLUDES  -o [loadfile] [sourcefile.c] -lbsd
  666.  
  667. If your software has system calls predefined with no prototype
  668. parameters, also use the -D_NO_PROTO flag.
  669.  
  670.  
  671. 2.03: Isn't the linker different from what I am used to?
  672.  
  673. Yes.  It is not at all like what you are used to:
  674.  
  675. - The order of objects and libraries is normally _not_ important.  The
  676.   linker reads _all_ objects including those from libraries into memory
  677.   and does the actual linking in one go.  Even if you need to put a
  678.   library of your own twice on the ld command line on other systems, it
  679.   is not needed on the RS/6000 - doing so will even make your linking slower.
  680.  
  681. - One of the features of the linker is that it will replace an object in
  682.   an executable with a new version of the same object:
  683.  
  684.   $ cc -o prog prog1.o prog2.o prog3.o        # make prog
  685.   $ cc -c prog2.c                # recompile prog2.c
  686.   $ cc -o prog.new prog2.o prog            # make prog.new from prog
  687.                         # by replacing prog2.o
  688.   
  689. - The standard C library /lib/libc.a is linked shared, which means that
  690.   the actual code is not linked into your program, but is loaded only
  691.   once and linked dynamically during loading of your program.
  692.  
  693. - The ld program actually calls the binder in /usr/lib/bind, and you can
  694.   give ld special options to get details about the invocation of the
  695.   binder.  These are found on the ld man page or in InfoExplorer.
  696.  
  697. - If your program normally links using a number of libraries (.a files),
  698.   you can 'prelink' each of these into an object, which will make your
  699.   final linking faster.  E.g. do:
  700.  
  701.   $ cc -c prog1.c prog2.c prog3.c
  702.   $ ar cv libprog.a prog1.o prog2.o prog3.o
  703.   $ ld -r -o libprog.o libprog.a
  704.   $ cc -o someprog someprog.c libprog.o
  705.  
  706. This will solve all internal references between prog1.o, prog2.o and
  707. prog3.o and save this in libprog.o Then using libprog.o to link your
  708. program instead of libprog.a will increase linking speed, and even if
  709. someprog.c only uses, say prog1.o and prog2.o, only those two modules
  710. will be in your final program.  This is also due to the fact that the
  711. binder can handle single objects inside one object module as noted above.
  712.  
  713. If you are using an -lprog option (for libprog.a) above, and still want
  714. to be able to do so, you should name the prelinked object with a
  715. standard library name, e.g. libprogP.a (P identifying a prelinked
  716. object), that can be specified by -lprogP.  You cannot use the archiver
  717. (ar) on such an object.
  718.  
  719. You should also have a look at section 3.01 of this article, in
  720. particular if you have mixed Fortran/C programs.
  721.  
  722.  
  723. 2.04: How do I link my program with a non-shared /lib/libc.a?
  724.  
  725.   cc -o prog -bnoso -bI:/lib/syscalls.exp obj1.o obj2.o obj3.o
  726.  
  727. will do that for a program consisting of the three objects obj1.o, etc.
  728.  
  729.  
  730. 2.05: How do I make my own shared library?
  731.  
  732. To make your own shared object or library of shared objects, you should
  733. know that a shared object cannot have undefined symbols.  Thus, if your
  734. code uses any externals from /lib/libc.a, the latter MUST be linked with
  735. your code to make a shared object.  Mike Heath (mike@pencom.com) said it
  736. is possible to split code into more than one shared object when externals
  737. in one object refer to another one.  You must be very good at
  738. import/export files.  Perhaps he or someone can provide an example. 
  739.  
  740. Assume you have one file, sub1.c, containing a routine with no external
  741. references, and another one, sub2.c, calling stuff in /lib/libc.a.  You
  742. will also need two export files, sub1.exp, sub2.exp.  Read the example
  743. below together with the examples on the ld man page. 
  744.  
  745. ---- sub1.c ----------------------------------------------------------
  746.     int addint(int a, int b)
  747.     {
  748.       return a + b;
  749.     }
  750. ---- sub2.c ----------------------------------------------------------
  751.     #include <stdio.h>
  752.  
  753.     void printint(int a)
  754.     {
  755.       printf("The integer is: %d\n", a);
  756.     }
  757. ---- sub1.exp ----------------------------------------------------------
  758.     #!
  759.     addint
  760. ---- sub2.exp ----------------------------------------------------------
  761.     #!
  762.     printint
  763. ---- usesub.c ----------------------------------------------------------
  764.     main()
  765.     {
  766.       printint( addint(5,8) );
  767.     }
  768. ---------------------------------------------------------------
  769.  
  770. The following commands will build your libshr.a, and compile/link the
  771. program usesub to use it.  Note that you need the ld option -lc for
  772. sub2shr.o since it calls printf from /lib/libc.a.
  773.  
  774.   $ cc  -c sub1.c
  775.   $ ld -o sub1shr.o sub1.o -bE:sub1.exp -bM:SRE -T512 -H512 
  776.   $ cc  -c sub2.c
  777.   $ ld -o sub2shr.o sub2.o -bE:sub2.exp -bM:SRE -T512 -H512  -lc
  778.   $ ar r libshr.a sub1shr.o sub2shr.o
  779.   $ cc -o usesub usesub.c -L: libshr.a
  780.   $ usesub
  781.   The integer is: 13
  782.   $
  783.  
  784.  
  785. 2.06: Linking my program fails with strange errors.  Why?
  786.  
  787. Very simple, the linker (actually called the binder), cannot get the
  788. memory it needs, either because your ulimits are too low or because you
  789. don't have sufficient paging space.  Since the linker is quite different
  790. from normal Unix linkers and actually does much more than these, it also
  791. uses a lot of virtual memory.  It is not unusual to need 10000 pages (of
  792. 4k) or more to execute a fairly complex linking.
  793.  
  794. If you get 'BUMP error', either ulimits or paging is too low, if you get
  795. 'Binder killed by signal 9' your paging is too low.
  796.  
  797. First, check your memory and data ulimits; in korn shell 'ulimit -a' will
  798. show all limits and 'ulimit -m 99999' and 'ulimit -d 99999' will
  799. increase the maximum memory and data respectively to some high values. 
  800. If this was not your problem, you don't have enough paging space.
  801.  
  802. If you will or can not increase your paging space, you could try this:
  803.  
  804. - Do you duplicate libraries on the ld command line? That is never
  805.   necessary.
  806.  
  807. - Do more users link simultaneously? Try having only one linking going
  808.   on at any time.
  809.  
  810. - Do a partwise linking, i.e. you link some objects/libraries with the
  811.   -r option to allow the temporary output to have unresolved references,
  812.   then link with the rest of your objects/libraries.  This can be split
  813.   up as much as you want, and will make each step use less virtual memory.
  814.  
  815.   If you follow this scheme, only adding one object or archive at a
  816.   time, you will actually emulate the behavior of other Unix linkers.
  817.  
  818. If you decide to add more paging space, you should consider adding a new
  819. paging space on a second hard disk, as opposed to just increasing the
  820. existing one.  Doing the latter could make you run out of free space on
  821. your first harddisk. It is more involved to shrink a paging space
  822. but easier to delete one.
  823.  
  824.  
  825. 2.07: What's with malloc()?
  826.  
  827. malloc() uses a late allocation algorithm based on 4.3 BSD's malloc()
  828. for speed.  This lets you allocate very large sparse memory spaces,
  829. since the pages are not actually allocated until they are touched for
  830. the first time.  Unfortunately, it doesn't die gracefully in the face of
  831. loss of available memory.  See the "Paging Space Overview" under
  832. InfoExplorer, and see the notes on the linker in this document for an
  833. example of an ungraceful death.
  834.  
  835. If you want your program to get notified when running out of memory, you
  836. should handle the SIGDANGER signal.  The default is to ignore it. 
  837. SIGDANGER is sent to all processes when paging space gets low, and if
  838. paging space gets even lower, processes with the highest paging space
  839. usage are sent the SIGKILL signal.
  840.  
  841. malloc() is substantially different in 3.2, allocating memory more
  842. tightly.  If you have problems running re-compiled programs on 3.2, try
  843. running them with MALLOCTYPE=3.1. 
  844.  
  845.  
  846. 2.08: Why does xlc complain about 'extern char *strcpy()'
  847.  
  848. The header <string.h> has a strcpy macro that expands strcpy(x,y) to
  849. __strcpy(x,y), and the latter is then used by the compiler to generate
  850. inline code for strcpy.  Because of the macro, your extern declaration
  851. contains an invalid macro expansion.  The real cure is to remove your
  852. extern declaration but adding -U__STR__ to your xlc will also do the trick.
  853.  
  854.  
  855. 2.09: Why do I get 'Parameter list cannot contain fewer ....'
  856.  
  857. This is the same as above.
  858.  
  859.  
  860. 2.10: Why does xlc complain about '(sometype *)somepointer = something'
  861.  
  862. Software that is developed using GNUC may have this construct.  However,
  863. standard C does not permit casts to be lvalues, so you will need to
  864. change the cast and move it to the right side of the assignment.  If you
  865. compile with 'cc', removing the cast completely will give you a warning,
  866. 'xlc' will give you an error (provided somepointer and something are of
  867. different types - but else, why would the cast be there in the first place?)
  868.  
  869.  
  870. 2.11: Some more common errors
  871.  
  872. Here are a few other common errors with xlc:
  873.  
  874. 305 |     switch((((np)->navigation_type) ? (*((np)->navigation_type)) :
  875.       ((void *)0)))
  876.       .a...........  
  877. a - 1506-226: (S) The second and third operands of the conditional
  878. operator must be of the same type.
  879.  
  880. The reason for this is that xlc defines NULL as (void *)0, and it does
  881. not allow two different types as the second and third operand of ?:. 
  882. The second argument above is not a pointer and the code used NULL
  883. incorrectly as a scalar.  NULL is a nil pointer constant in ANSI C and
  884. in some traditional compilers.
  885.  
  886. You should change NULL in the third argument above to an integer 0.
  887.  
  888.  
  889. 2.12: Can the compiler generate assembler code?
  890.  
  891. The traditional -S option is not supported by the XLC compiler, and
  892. there is in fact no way to make the compiler generate machine readable
  893. assembler code.  The option -qlist will generate a human readable one in
  894. the .lst file.
  895.  
  896.  
  897. 2.13: Curses
  898.  
  899. Curses based applications should be linked with -lcurses and _not_ with
  900. -ltermlib.  It has also been reported that some problems with curses are
  901. avoided if your application is compiled with -DNLS.
  902.  
  903. Peter Jeffe <peter@ski.austin.ibm.com> also notes:
  904.  
  905. >the escape sequences for cursor and function keys are *sometimes*
  906. >treated as several characters: eg. the getch() - call does not return
  907. >KEY_UP but 'ESC [ C.'
  908.  
  909. You're correct in your analysis: this has to do with the timing of the
  910. escape sequence as it arrives from the net.  There is an environment
  911. variable called ESCDELAY that can change the fudge factor used to decide
  912. when an escape is just an escape.  The default value is 500; boosting
  913. this a bit should solve your problems.
  914.  
  915. Further on the matter of curses, I've received the comments below
  916. concerning extended curses:
  917.  
  918. From: Christopher Carlyle O'Callaghan <asdfjkl@wam.umd.edu>
  919.  
  920. 1) The sample program in User Interface Programming Concepts, page 7-13
  921.    is WRONG. Here is the correct use of panes and panels.  (This is
  922.    one of the IBM manuals that comes with the RS/6000)
  923.  
  924. #include <cur01.h>
  925. #include <cur05.h>
  926.  
  927. main()
  928. {
  929. PANE *A, *B, *C, *D, *E, *F, *G, *H;
  930. PANEL *P;
  931.  
  932. initscr();
  933.  
  934. A = ecbpns (24, 79, NULL, NULL, 0, 2500, Pdivszp, Pbordry, NULL, NULL);
  935.  
  936. D = ecbpns (24, 79, NULL, NULL, 0, 0,    Pdivszf, Pbordry, NULL, NULL);
  937. E = ecbpns (24, 79, D,    NULL, 0, 0,    Pdivszf, Pbordry, NULL, NULL);
  938.  
  939. B = ecbpns (24, 79, A, D, Pdivtyh, 3000, Pdivszp, Pbordry, NULL, NULL);
  940.  
  941. F = ecbpns (24, 79, NULL, NULL, 0, 0,    Pdivszf, Pbordry, NULL, NULL);
  942. G = ecbpns (24, 79, F,    NULL, 0, 5000, Pdivszp, Pbordry, NULL, NULL);
  943. H = ecbpns (24, 79, G,    NULL, 0, 3000, Pdivszp, Pbordry, NULL, NULL);
  944.  
  945. C: = ecbpns (24, 79, B, F, Pdivtyh, 0, Pdivszf, Pbordry, NULL, NULL);
  946.  
  947. P = ecbpls (24, 79, 0, 0, "MAIN PANEL", Pdivtyv, Pbordry, A);
  948.  
  949. ecdvpl (P);
  950. ecdfpl (P, FALSE);
  951. ecshpl (P); 
  952. ecrfpl (P);
  953. endwin();
  954. }
  955.  
  956. 2) DO NOT include <curses.h> and any other <cur0x.h> file together.
  957.    You will get a bunch of redefined statements.
  958.  
  959. 3) There is a CURSES and EXTENDED CURSES stuff.  Use only one or the
  960.    other. If the manual says that they're backwards compatible or some
  961.    other indication that you can use CURSES routines with EXTENDED,
  962.    don't believe it. To use CURSES you need to include <curses.h> and
  963.    you can't (see above).
  964.  
  965. 4) If you use -lcur and -lcurses in the same link command, you will get
  966.    Memory fault (core dump) error...  YOU CANNOT use both of them at the
  967.    same time. -lcur is for extended curses, -lcurses is for regular curses.
  968.  
  969. 5) When creating PANEs, when you supply a value (other than 0) for the
  970.    'ds' parameter and use Pdivszf value for the 'du' parameter, the 'ds'
  971.    will be ignored (the sample program on page 7-13 in User Interface
  972.    Programming Concepts is wrong.) For reasons as yet undetermined,
  973.    Pdivszc doesn't seem to work (or at least I can't figure out how to
  974.    use it.)
  975.  
  976. 6) If you're running into bugs and can't figure out what is happening,
  977.    try the following:
  978.    include -qextchk -g in your compile line
  979.     -qextchk will check to make sure you're passing the right number of
  980.        parameters to the procedures
  981.     -g will allow you to use the inline debugger on Unix/AIX.
  982.    to use the debugger after you compiled it, 
  983.     type: dbx <fn>
  984.     the command 'help' will give you all of the possible commands to
  985.        use in the debugger... have fun... :)
  986.  
  987. 7) Do not use 80 as the number of columns if you're gonna use the whole
  988.    screen. The lower right corner will get erased.  Use 79 instead.
  989.  
  990. 8) If you create a panel, you must create at least 1 pane, otherwise you
  991.    will get a Memory fault (core dump).
  992.  
  993. 9) When creating a panel, if you don't have a border around it, any title
  994.    you want will not show up.
  995.  
  996. 10) to make the screen scroll down:
  997.     wmove (win, 0, 0);
  998.     winsertln (win)
  999.  
  1000. 11) delwin(win) DOESN'T WORK IN EXTENDED WINDOWS.
  1001.  
  1002.     Anyway, to make it appear as if a window is deleted, you need to do
  1003.     the following:
  1004.     for every window that you want to appear on the screen
  1005.     touchwin(win)
  1006.     wrefresh(win)
  1007.  
  1008.     you must make sure that you do it in the exact same order as you put
  1009.     them on the screen (i.e., if you called newwin with A, then C, then B,
  1010.     then you must do the loop with A, then C, then B, otherwise you won't
  1011.     get the same screen back).  The best thing to do is to put them into
  1012.     an array and keep track of the last window index.
  1013.  
  1014. 12) mvwin(win, line, col) implies that it is only used for viewports and
  1015.     subwindows... It can also be used for the actual windows themselves.
  1016.  
  1017. 13) If you specify the attribute of a window using wcolorout(win), any
  1018.     subsequent calls to chgat(numchars, mode) or any of its relatives
  1019.     will not work. (or at least they get very picky...)
  1020.  
  1021.  
  1022. 2.14: How do I speed up linking
  1023.  
  1024. Please refer to sections 2.03 and 2.06 above.
  1025.  
  1026.  
  1027. 2.15: What is deadbeef?
  1028.  
  1029. When running the debugger (dbx), you may have wondered what the
  1030. 'deadbeef' is you occasionally see in registers.  Do note, that
  1031. 0xdeadbeef is a hexadecimal number that also happens to be some kind
  1032. of word (the RS/6000 was built in Texas!), and this hexadecimal number
  1033. is simply put into unused registers at some time, probably during
  1034. program startup.
  1035.  
  1036.  
  1037. 2.16: How do I statically link in 3.2?
  1038.  
  1039. xlc -bnso -bI:/lib/syscalls.exp -liconv -bnodelcsect 
  1040.  
  1041. _____________________________________________________________________________
  1042. 3.00: Fortran and other compilers
  1043.  
  1044. This section covers Fortran, Pascal, Ada, etc.  On Fortran, there seem
  1045. to have been some problems with floating point handling, in particular
  1046. floating exceptions.
  1047.  
  1048.  
  1049. 3.01: I have problems mixing Fortran and C code, why?
  1050.  
  1051. A few routines (the most famous one is getenv) exist in both the Fortran
  1052. and the C library but with different parameters.  You can therefore not
  1053. have a mixed program that call getenv from both C and Fortran code. 
  1054. When linking a mixed program calling getenv from either, be sure to
  1055. specify the correct library first on your command line.  If your main
  1056. program is Fortran and you call getenv from a C routine, you must
  1057. therefore add -lc to the xlf command line for linking.
  1058.  
  1059. If you want to call getenv from both C and Fortran code in a mixed
  1060. program, you need to compile all the Fortran code with the -qextname
  1061. option.  This appends an underscore to all Fortran external names and
  1062. ensures that no confusion occurs with default C libraries.  Of course an
  1063. underscore should be added by hand in the C code to the name of all
  1064. routines which are called form Fortran and to all calls to Fortran
  1065. routines.  If you do that, Fortran will call something which appears to
  1066. C as getenv_ and there will be no confusion.
  1067.  
  1068.  
  1069. 3.02: How do I statically bind Fortran libraries and dynamically
  1070.       bind C libraries?
  1071. From: amaranth@vela.acs.oakland.edu (Paul Amaranth)
  1072.  
  1073. [ Editor's note: Part of this is also discussed above under the C compiler
  1074.   section, but I felt it was so valuable that I have left it all in. 
  1075.   I've done some minor editing, mostly typographical. ]
  1076.  
  1077. The linker and binder are rather versatile programs, but it is not
  1078. always clear how to make them do what you want them to.  In particular,
  1079. there are times when you do not want to use shared libraries, but
  1080. rather, staticly bind the required routines into your object.  Or, you
  1081. may need to use two version of the same routine (eg, Fortran & C).  Here
  1082. are the results of my recent experiments.  I would like to thank Daniel
  1083. Premer and Brad Hollowbush, my SE, for hints.  Any mistakes or omissions
  1084. are my own and I have tended to interchange the terms "linker" and
  1085. "binder".  These experiments were performed on AIX 3.1.2.  Most of this
  1086. should be applicable to later upgrades of 3.1.
  1087.  
  1088. 1)  I have some C programs, I want to bind in the runtime routines.  How
  1089.     do I do this? [Mentioned in section 2.04 of this article as well, ed.]
  1090.  
  1091.     You can put the -bnso binder command on the link line.  You should
  1092.     also include the -bI:/lib/syscalls.exp control argument:
  1093.       
  1094.       $ cc *.o -bnso -bI:/lib/syscalls.exp -o foo
  1095.  
  1096.     This will magically do everything you need.  Note that this will bind
  1097.     _all_ required routines in.  The -bI argument tells the linker that
  1098.     these entry points will be resolved dynamically at runtime (these are
  1099.     system calls).  If you omit this you will get lots of unresolved 
  1100.     reference messages.
  1101.  
  1102. 2)  I want to staticly bind in the Fortran runtime so a) my customers do
  1103.     not need to buy it and b) I don't have to worry about the runtime
  1104.     changing on a new release.  Can I use the two binder arguments in
  1105.     1) to do this?
  1106.  
  1107.     You should be able to do so, but, at least under 3002, if you do
  1108.     you will get a linker error referencing getenv.  In addition, there
  1109.     are a number of potential conflicts between Fortran and C routines.
  1110.     The easy way just does not work.  See the section on
  1111.     2 stage linking for C and Fortran on how to do this.  The getenv
  1112.     problem is a mess, see the section on Comments & Caveats for more.
  1113.  
  1114. 3)  I have a mixture of C and Fortran routines, how can I make sure
  1115.     that the C routines reference the C getenv, while the Fortran routines
  1116.     reference the Fortran getenv (which has different parameters and, if
  1117.     called mistakenly by a C routine results in a segmentation fault)?
  1118.  
  1119.     From Mike Heath (mike@pencom.com):
  1120.  
  1121.     Use -brename:symbol1,symbol2 when pre-linking the modules from one
  1122.     of the languages. It does not matter which one you choose.
  1123.  
  1124. 4)  I have C and Fortran routines.  I want to bind in the xlf library, while
  1125.     letting the rest of the libraries be shared.  How do I do this?
  1126.  
  1127.     You need to do a 2 stage link.  In the first stage, you bind in the
  1128.     xlf library routines, creating an intermediate object file.  The
  1129.     second stage resolves the remaining references to the shared libraries.
  1130.  
  1131.     This is a general technique that allows you to bind in specific system
  1132.     routines, while still referencing the standard shared libraries.
  1133.  
  1134.     Specifically, use this command to bind the xlf libraries to the Fortran
  1135.     objects:
  1136.  
  1137.        $ ld -bh:4 -T512 -H512 <your objects> -o intermediat.o \
  1138.          -bnso -bI:/lib/syscalls.exp -berok -lxlf -bexport:/usr/lib/libg.exp \
  1139.          -lg -bexport:<your export file>
  1140.  
  1141.     The argument -bexport:<your export file> specifies a file with the
  1142.     name of all entry points that are to be visible outside the intermediate 
  1143.     module.  Put one entrypoint name on a line.  The -bI:/lib/libg.exp line 
  1144.     is required for proper functioning of the program.  The -berok argument 
  1145.     tells the binder that it is ok to have unresolved references, at least 
  1146.     at this time (you would think -r would work here, but it doesn't seem to).  
  1147.     The -bnso argument causes the required modules to be imported
  1148.     into the object.  The -lxlf, of course, is the xlf library.
  1149.  
  1150.     Then, bind the intermediate object with the other shared libraries in
  1151.     the normal fashion:
  1152.  
  1153.        $ ld -bh:4 -T512 -H512 <C or other modules> intermediate.o \
  1154.          /lib/crt0.o -lm -lc
  1155.  
  1156.     Note the absence of -berok.  After this link, all references should
  1157.     be resolved (unless you're doing a multistage link and making another
  1158.     intermediate).
  1159.  
  1160.     NOTE THE ORDER OF MODULES.  This is extremely important if, for example,
  1161.     you had a subroutine named "load" in your Fortran stuff.  Putting the
  1162.     C libraries before the intermediate module would make the C "load"
  1163.     the operable definition, rather than the Fortran version EVEN THOUGH 
  1164.     THE FORTRAN MODULE HAS ALREADY BEEN THROUGH A LINK AND ALL REFERENCES 
  1165.     TO THE SYMBOL ARE CONTAINED IN THE FORTRAN MODULE.  This can
  1166.     be extremely difficult to find (trust me on this one :-)  Is this
  1167.     a bug, a feature, or what?
  1168.     
  1169.     [As mentioned in section 2.03 of this article, it is a feature that you
  1170.     can replace individual objects in linked files, ed.]
  1171.  
  1172.     The result will be a slightly larger object than normal.  (I say slightly
  1173.     because mine went up 5%, but then its a 2 MB object :-)
  1174.  
  1175.  
  1176. Comments & Caveats:
  1177.  
  1178.    From the documentation the -r argument to the linker should do what
  1179.    -berok does.  It does not.  Very strange results come from using the
  1180.    -r argument.  I have not been able to make -r work in a sensible manner
  1181.    (even for intermediate links which is what it is supposed to be for).
  1182.  
  1183.        Note from Mike Heath (mike@pencom.com):
  1184.  
  1185.        'ld -r' is essentially shorthand for 'ld -berok -bnogc -bnoglink'.
  1186.        Certainly, using -berok with an export file (so garbage collection
  1187.        can be done) is preferable to ld -r, but the latter is easier.
  1188.  
  1189.    When binding an intermediate module, use an export file to define the
  1190.    entry points you want visible in the later link.  If you don't do this,
  1191.    you'll get the dreaded "unresolved reference" error.  Import files name
  1192.    entry points that will be dynamically resolved (and possibly where).
  1193.  
  1194.    If you are in doubt about what parameters or libraries to link, use the
  1195.    -v arg when linking and modify the exec call that shows up into 
  1196.    an ld command.  Some thought about the libraries will usually yield an
  1197.    idea of when to use what.  If you don't know what an argument is for,
  1198.    leave it in.  It's there for a purpose (even if you don't understand it).
  1199.  
  1200.    Watch the order of external definitions (ie, libraries) when more than
  1201.    one version of a routine may show up, eg "load".  The first one defined
  1202.    on the ld command line is the winner.  
  1203.  
  1204.    The getenv (and system and signal) problem is a problem that started out
  1205.    minor, got somewhat worse in 3003 and, eventually will be correctly fixed.
  1206.    Basically, you should extract the 3002 version of these three routines
  1207.    from xlf.a before doing the update and save them away, then link these
  1208.    routines in if you use these Fortran system services.  
  1209.  
  1210.  
  1211. 3.03: How do I check if a number is NaN?
  1212.  
  1213. [ From: sdl@glasnost.austin.ibm.com (Stephen Linam) ]
  1214.  
  1215. NaN is "Not a Number".  It arises because the RISC System/6000 uses
  1216. IEEE floating point arithmetic.
  1217.  
  1218. To determine if a variable is a NaN you can make use of the property
  1219. that a NaN does not compare equal to anything, including itself.
  1220. Thus, for real variable X, use
  1221.  
  1222.     IF (X .NE. X) THEN    ! this will be true if X is NaN
  1223.  
  1224. Floating point operations which cause exceptions (such as an overflow)
  1225. cause status bits to be set in the Floating Point Status and Control
  1226. Register (FPSCR).  There is a Fortran interface to query the FPSCR, and
  1227. it is described in the XLF Fortran manuals -- I don't have the manuals
  1228. right here, but look for FPGETS and FPSETS.
  1229.  
  1230. The IBM manual "Risc System/6000 Hardware Technical Reference - General
  1231. Information" (SA23-2643) describes what floating point exceptions can
  1232. occur and which bits are set in the FPSCR as a result of those exceptions.
  1233.  
  1234.  
  1235. 3.04: Some info sources on IEEE floating point
  1236.  
  1237. 1. ANSI/IEEE STD 754-1985 (IEEE Standard for Binary Floating-Point
  1238.    Arithmetic) and ANSI/IEEE STD 854-1987 (IEEE Standard for
  1239.    Radix-Independent Floating-Point Arithmetic), both available from IEEE. 
  1240.  
  1241. 2. David Goldberg, "What Every Computer Scientist Should Know About
  1242.    Floating-Point Arithmetic", ACM Computing Surveys, Vol. 23, No. 1,
  1243.    March 1991, pp. 5-48.
  1244.  
  1245. ______________________________________________________________________________
  1246. 4.00: GNU and Public Domain software
  1247.  
  1248. GNU software comes from the Free Software Foundation and various other
  1249. sources. A number of ftp sites archive them. Read the GNU license for 
  1250. rules on distributing their software.
  1251.  
  1252. Lots of useful public domain software have been and continue to be ported
  1253. to the RS/6000. See below for ftp or download information.
  1254.  
  1255.  
  1256. 4.01: How do I find sources?
  1257.  
  1258. [ From jik@GZA.COM (Jonathan Kamens).  Ed. ]
  1259.  
  1260. There is a newsgroup devoted to posting about how to get a certain
  1261. source.  One is strongly urged to follow the guidelines in the article
  1262. How_to_find_sources(READ_THIS_BEFORE_POSTING), available via anonymous
  1263. ftp from rtfm.mit.edu (18.70.0.226):
  1264.  
  1265. /pub/usenet/comp.sources.wanted/H_t_f_s_(R_T_B_P)
  1266.  
  1267. Note: You should try to use hostnames rather than ip addresses since
  1268. they are much less likely to change.
  1269.  
  1270. Also available from mail-server@rtfm.mit.edu by sending a mail
  1271. message containing:
  1272.  
  1273. send usenet/comp.sources.wanted/H_t_f_s_(R_T_B_P)
  1274.  
  1275. Send a message containing "help" to get general information about the
  1276. mail server.
  1277.  
  1278. If you don't find what you were looking for by following these
  1279. guidelines, you can post a message to comp.sources.wanted.
  1280.  
  1281.  
  1282. 4.02: Are there any ftp sites?
  1283.  
  1284. Below are some ftp sites that are supposed to have RS/6000 specific software.
  1285. I haven't verified all the entries.  I dropped cs.utk.edu (128.169.201.1) and
  1286. merit.edu (35.1.1.42) because I cannot find any AIX material.
  1287.  
  1288. US sites:
  1289. aixpdslib.seas.ucla.edu    128.97.2.211    pub
  1290. acd.ucar.edu        128.117.32.1     pub/AIX         
  1291. acsc.acsc.com       143.127.0.2    pub
  1292. byron.u.washington.edu    128.95.48.32    pub/aix/RS6000  (older stuff)
  1293. lightning.gatech.edu    128.61.10.8    pub/aix
  1294. tesla.ee.cornell.edu    128.84.253.11    pub
  1295.  
  1296. European sites:
  1297. nic.funet.fi         128.214.6.100    pub/unix/AIX/RS6000
  1298. iacrs1.unibe.ch     130.92.11.3     pub
  1299.  
  1300. The first one above is dedicated to software running on AIX.  It might
  1301. not always be the latest versions of the software, but it has always
  1302. been ported to AIX (normally AIX version 3 only).  Once connected, you
  1303. should retrieve the files README and pub/ls-lR.
  1304.  
  1305. Please use the European sites very sparingly.  They are primarily to
  1306. serve people in Europe and most of the software can be found in the US
  1307. sites originally.
  1308.  
  1309. If you know of other sites with AIX archives please let me know so
  1310. I can include them here.
  1311.  
  1312.  
  1313. 4.03: General hints
  1314.  
  1315. In general, curses based applications should be linked with -lcurses and
  1316. _not_ with -ltermlib.  It has also been reported that compiling with
  1317. -DNLS helps curses based programs.
  1318.  
  1319. Note that the RS/6000 has two install programs, one with System V flavor
  1320. in the default PATH (/etc/install with links from /usr/bin and /usr/usg),
  1321. and one with BSD behavior in /usr/ucb/install.
  1322.  
  1323.  
  1324. 4.04: GNU Emacs
  1325.  
  1326. Version 18.57 of GNU Emacs started to have RS/6000 support.  Use
  1327. s-aix3-2.h for AIX 3.2. Emacs is going through rapid changes recently.
  1328. Current release is 19.x.
  1329.  
  1330. Emacs will core-dump if it is stripped, so don't strip when you install
  1331. it.  You can edit a copy of the Makefile in src replacing all 'install -s' 
  1332. with /usr/ucb/install.
  1333.  
  1334.  
  1335. 4.05: gcc/gdb
  1336.  
  1337. GNU C version 2.0 and later supports the RS/6000, and compiles straight
  1338. out of the box.  You may, however, experience that compiling it requires
  1339. large amounts of paging space.
  1340.  
  1341. Compiling gcc and gdb requires a patch to the 'as' assembler.  Call
  1342. IBM software support and request patch for apar IX26107 (U409205).
  1343.  
  1344. gcc has undergone many changes lately and the current version is 2.4.x.
  1345. gdb is at 4.8.
  1346.  
  1347. If your machine crashed when trying to run gdb 4.7, call software support
  1348. and request ptf U412815.
  1349.  
  1350.  
  1351. 4.06: GNU Ghostscript
  1352.  
  1353. The PostScript interpreter GNU Ghostscript Version 2.3 and later supports
  1354. the RS/6000 and can be found on various ftp sites. Current version is 2.5.2.
  1355.  
  1356. 4.07: TeX
  1357.  
  1358. TeX can be retrieved via ftp from ftp.uni-stuttgart.de.
  1359. Be sure to use a recent C compiler (01.02.0000.0013) and you can compile
  1360. with optimization.
  1361.  
  1362.  
  1363. 4.08: perl
  1364.  
  1365. Current version is 4.035 and compiling with cc should give no problems. 
  1366. If you use bsdcc, do not use perl's builtin malloc(), edit config.H to
  1367. '#define HAS_SYMLINK', and you should be on your way.  Bill Wohler tells
  1368. me that perl will run without editing config.H and with cc as well.  So
  1369. just say no to use perl's malloc().
  1370.  
  1371. Doug Sewell <DOUG@YSUB.YSU.EDU> adds:
  1372.  
  1373. In addition to not using the perl-provided malloc, when asked if you
  1374. want to edit config.sh, change 'cppstdin' from the wrapper-program
  1375. to '/lib/cpp'.
  1376.  
  1377. The perl wrapper name is compiled into perl, and requires that you keep
  1378. that file in the source directory, even if you blow away the rest of
  1379. the source.  /lib/cpp will do the job by itself.  I suspect this will
  1380. be fixed in perl 4.0pl11 Configure script.
  1381.  
  1382. Also, beware if you have gdbm installed per the instructions in the FAQ.
  1383. Gdbm is compiled with bsdcc; perl (as I installed it, anyway) was built
  1384. with cc, so I used the IBM-provided ndbm routines.
  1385.  
  1386.  
  1387. 4.09: X-Windows
  1388.  
  1389. IBM has two releases of 3.2.3. The base version has X11R4 and Motif 1.1 and
  1390. the extended version has X11R5 as AIXwindows 1.2.3.
  1391.  
  1392. Those of you on 3.1 might want to read the following.  Some people from
  1393. IBM have released patches for the X11R4 distribution tape available via
  1394. anonymous FTP from export.lcs.mit.edu.  Note that as with the RT, there
  1395. is no X11R4 server to build, just the libraries.
  1396.  
  1397. From: Frederick Staats <fritz@saturn.ucsc.edu>
  1398.  
  1399. In mit/config/ibm.cf
  1400.     Updated OSName (AIX 3.1.6)
  1401.  
  1402. In mit/config/site.def
  1403.     Changed ProjectRoot /usr/local/X11R5
  1404.     Added ManSuffix (to change suffix from n to 1)
  1405.     Added InstallXdmConfig YES and
  1406.     InstallXinitConfig YES
  1407.     Added HasXdmAuth YES (Copied mit/lib/Xdmcp/Wraphelp.c to source tree)
  1408.     Added InstallFSConfig YES
  1409.  
  1410. In mit
  1411.     nohup make BOOTSTRAPCFLAGS="-Daix" World &
  1412.     nohup make install &
  1413.     nohup make install.man &
  1414.  
  1415. Please note that there are known bugs in Xibm server of the X11R5
  1416. release that prevent "xdm" from being usable.  A simple patch (that I'm
  1417. not free to redistribute) should be out very soon through the regular
  1418. contrib channels.
  1419.  
  1420. Also note, that some files in mit/extensions/lib/PEX/c_binding are very
  1421. large and are told to require at least 150 Mb paging space to compile.
  1422.  
  1423. Apparently, only the Skyway adapter is supported for X11R5.
  1424.  
  1425. [the Skyway adapter is "IBM Color Graphics Display Adaptor" in IBM
  1426. documents, the "IBM High-Performance 8- or 24-Bit 3D Color Graphics
  1427. Processor" is the Sabine.  Ed.]
  1428.  
  1429. From: pierce@claven.cambridge.ibm.com (Andrew Pierce)
  1430.  
  1431. The following bugs have been reported with the R5 server and are fixed
  1432. (hopefully!), and the fixes have been sent to MIT for inclusion in the
  1433. first patch set:
  1434.  
  1435. - BackingStore does not seem to work (twm menus blank and xman pulldown 
  1436.   menus only display once).
  1437. - Problem in keyclick restoration/bell
  1438. - Problem with option parsing (-bs does not turn off backing store).
  1439. - Problem with setting non-blocking I/O on X Connections 
  1440.   (resizing xcalc wedges the server).
  1441. - xdm core dumps. 
  1442.  
  1443. There is also a problem in initializing the display adapter when the R5
  1444. server is brought up from a poweroff condition on the RISC/6000.  We are
  1445. still investigating this problem.  A temporary workaround is to run the
  1446. AIX product server first, which seems to do the right thing in
  1447. initializing the adapter, then run the R5 server.
  1448.  
  1449. As for whether the OSF/Motif window manager will work with the R5
  1450. server, I don't know of any reasons why it shouldn't, and I've run it
  1451. now and again, although tvtwm is my preferred wm.
  1452.  
  1453. From: cary@jove.Colorado.EDU (John R. Cary)
  1454.  
  1455. There are (at least) three problems.  
  1456.  
  1457. 1) The fonts as built with the IBM (Greening) patches of X11R4 do not
  1458. work with the AIX3.1.5 server because (according to mleisher@NMSU.Edu)
  1459. they likely have the wrong byte order.
  1460. 2) The ibm fonts that come with AIX3.1.5 must be converted to .pcf fonts
  1461. to work with the X11R5 server.
  1462. 3) Info always looks for its fonts (in /usr/lpp/info/X11fonts)
  1463. regardless of which server you are using.  So if you use the X11R5
  1464. server, info loads the AIX3.1x .snf fonts, which do not work with the
  1465. X11R5 server.
  1466.  
  1467. Using the X11R5 server means that you must fix problems 2 and 3.
  1468.  
  1469. My fix of 2: I first got snftobdf from the X11 contrib directory on
  1470. export.lcs.mit.edu and built it. I then made a directory:
  1471. mkdir /usr/local/X11R5/lib/X11/fonts/ibm
  1472. which I added to my font path with xset in my .xinitrc file.
  1473. Then I constructed the chosen .pcf fonts one at a time:
  1474. cd /usr/lib/X11/fonts
  1475. snftobdf Rom10.snf | bdftopcf >/usr/local/X11R5/lib/X11/fonts/ibm/Rom10.pcf
  1476.  
  1477. I actually did this with this script:
  1478.  
  1479. #!/bin/ksh 
  1480. # A script to convert desired AIX fonts to .pcf fonts for X11R5 
  1481. for arg in 6x10 Bld14 Rom14 Rom6 6x12 Bld17 Rom16 Rom7 vtbold 6x13
  1482. Erg 14 Rom17 Rom8 vtdhbot 8x13 Itl14 Rom22 cursor vtdhtop 8x13B Rom10
  1483. Rom28 fixed vtdwidth 9x15 Rom11 Rom29 Vtsingle 
  1484. do
  1485. echo "snftobdf $arg.snf | bdftopcf >/usr/local/X11R5/lib/X11/fonts/ibm/$arg.pcf"
  1486. snftobdf $arg.snf | bdftopcf >/usr/local/X11R5/lib/X11/fonts/ibm/$arg.pcf
  1487. done
  1488.  
  1489. My fix of 3: was simply to rename the info fonts directory so that info
  1490. could not find it and load it.  Another fix (I am told) is to set one's
  1491. font path with /usr/lpp/info/X11fonts last so that another fonts is
  1492. loaded first.  This did not work for me, perhaps because of differences
  1493. in my fonts.alias file.
  1494.  
  1495. If you want to continue using the AIX3.1x server and you want to use the
  1496. X11R4 fonts, you must convert these fonts to the correct bit order.  I
  1497. did not do this, and so DO NOT KNOW the correct procedure.  I imagine
  1498. that once the correct bit order is determined, one can use snftobdf to
  1499. convert fonts back to bdf format then bdftosnf with correct AIX3.1 bit
  1500. order to get things correct with the aix3.1x server.
  1501.  
  1502.  
  1503. 4.10: bash
  1504.  
  1505. Bash is ported and has some patches on prep.ai.mit.edu.  The current
  1506. version is 1.12 and seems to work fine.
  1507.  
  1508.  
  1509. 4.11: Elm
  1510.  
  1511. A very nice replacement for mail.  Elm should be pretty straightforward,
  1512. the only thing to remember is to link with -lcurses as the only
  1513. curses/termlib library.  You may also run into the problem listed under
  1514. point 2.13 above.
  1515.  
  1516.  
  1517. 4.12: Oberon 2.2
  1518.  
  1519. From: afx@muc.ibm.de (Andreas Siegert)
  1520.  
  1521. Oberon is Wirth's follow on to Modula-2, but is not compatible.  A free
  1522. version of Modula-3 is available from DEC/Olivetti at
  1523. gatekeeper.dec.com.  This is not a Modula-2 replacement but a new
  1524. language.  There are currently two M2 compilers for the 6000 that I know
  1525. of.  One from Edinburgh Portable Compilers, +44 31 225 6262 (UK) and the
  1526. other from Gardens Point compiler +41 65 520311 (Switzerland).
  1527.  
  1528. Oberon can be obtained via anonymous ftp from neptune.inf.ethz.ch
  1529. (129.132.101.33) under the directory Oberon/RS6000 or gatekeeper.dec.com
  1530. (16.1.0.2).
  1531.  
  1532.  
  1533. 4.13: Kermit
  1534.  
  1535. Get it from watsun.cc.columbia.edu (128.59.39.2) in
  1536. kermit/bin/cku188.tar.Z.  Uncompress, untar, and "make rs6000", and it
  1537. works. 
  1538.  
  1539.  
  1540. 4.14: Gnu dbm
  1541. From: doug@cc.ysu.edu (Doug Sewell)
  1542.  
  1543. Here's the fixes for RS/6000's: 
  1544.  
  1545. apply this to testgdbm.c:
  1546. 158c158
  1547. <   char opt;
  1548. ---
  1549. >   int opt;
  1550. 166c166
  1551. <   while ((opt = getopt (argc, argv, "rn")) != -1)
  1552. ---
  1553. >   while ((opt = getopt (argc, argv, "rn")) != EOF)
  1554.  
  1555. Apply this to systems.h:
  1556. 111a112,114
  1557. > #ifdef RS6000
  1558. > #pragma alloca
  1559. > #else
  1560. 112a116
  1561. > #endif
  1562.  
  1563. To compile, edit the Makefile.  Set CC to bsdcc (see /usr/lpp/bos/bsdport
  1564. if you don't have 'bsdcc' on your system) and set CFLAGS to -DRS6000 and
  1565. whatever options (-g, -O) you prefer.  Don't define SYSV.
  1566.  
  1567.  
  1568. 4.15: tcsh
  1569. From: cordes@athos.cs.ua.edu (David Cordes)
  1570.  
  1571. tcsh is available from tesla.ee.cornell.edu (pub/tcsh-6.00 directory)
  1572. Compiles with no problems.  You must edit /etc/security/login.cfg to
  1573. permit users to change to this shell (chsh), adding the path where the
  1574. shell is installed (in my case, /usr/local/bin/tcsh).
  1575.  
  1576.  
  1577. 4.16: Kyoto Common Lisp
  1578.  
  1579. The sources are available from cli.com.  The kcl package is the needed
  1580. base; also retrieve the latest akcl distribution.  akcl provides a
  1581. front-end that "ports" the original kcl to a number of different
  1582. platforms.  The port to the 6000s worked with no problems.  However, you
  1583. must be "root" for the make to work properly with some memory protection
  1584. routines.
  1585.  
  1586.  
  1587. 4.17: Tcl/Tk
  1588.  
  1589. Current versions: Tcl, 6.7; Tk, 3.2.  Available from sprite.berkeley.edu.
  1590. I seem to be unable to connect to this site recently.
  1591.  
  1592.  
  1593. 4.18: Expect
  1594. From: Doug Sewell <DOUG@YSUB.YSU.EDU>
  1595.    
  1596. To build the command-interpreter version, you must have the tcl library
  1597. built successfully.  The expect library doesn't require tcl.  Note:
  1598. Expect and its library are are built with bsdcc, so applications using
  1599. the library probably also need to be developed with bsdcc.
  1600.  
  1601. I ftp'd expect from ftp.cme.nist.gov.
  1602.  
  1603. You need to change several lines in the makefile.  First you need
  1604. to customize source and target directories and files:
  1605. #
  1606. TCLHDIR = /usr/include
  1607. TCLLIB = -ltcl
  1608. MANDIR = /usr/man/manl               (local man-pages)
  1609. MANEXT = l
  1610. BINDIR = /u/local/bin
  1611. LIBDIR = /usr/lib
  1612. HDIR = /usr/include
  1613. ...
  1614. Next set the compiler, switches, and configuration options:
  1615. #
  1616. CC = bsdcc
  1617. CFLAGS = -O
  1618. ...
  1619. PTY_TYPE = bsd
  1620. ...
  1621. INTERACT_TYPE = select
  1622. ...
  1623. Then you need to make these changes about line 90 or so:
  1624. comment out CFLAGS = $(CLFLAGS)
  1625. un-comment these lines:
  1626. CFLAGS = $(CLFLAGS) $(CPPFLAGS)
  1627. LFLAGS = ($CLFLAGS)
  1628.  
  1629. Then run 'make'.
  1630.  
  1631. You can't run some of the examples without modification (host name,
  1632. etc).  I don't remember if I ran all of them or not, but I ran enough
  1633. that I was satisfied it worked.
  1634.  
  1635.  
  1636. 4.19: Public domain software on CD
  1637. From: mbeckman@mbeckman.mbeckman.com (Mel Beckman)
  1638.  
  1639. The Prime Time Freeware CD collection is a package of two CD's and docs
  1640. containing over THREE GIGABYTES of compressed Unix shareware. It costs $69
  1641. from Prime Time Freeware, 415-112 N. Mary Ave., Suite 50, Sunnyvalek, CA
  1642. 94086. Phone 408-738-4832 voice, 408-738-2050 fax. No internet orders as
  1643. far as I can tell.
  1644.  
  1645. I've extracted and compiled a number of the packages, and all have worked
  1646. flawlessly so far on my 220. Everything from programming languages to 3D
  1647. solid modeling is in this bonanza!
  1648.  
  1649. Ed: The O'Reilly book, Power Unix Tools, also contains a CD-ROM with lots
  1650. of useful programs compiled for the RS/6000, among other platforms.
  1651.  
  1652. ______________________________________________________________________________
  1653. 5.00: Third party products
  1654.  
  1655. [ Editor's note: Entries in this section are edited to prevent from
  1656.   looking like advertising. Prices given may be obsolete.  Companies 
  1657.   mentioned are for reference only and are not endorsed in any fashion. ]
  1658.  
  1659.  
  1660. 5.01: IBM list of third party products
  1661. From: marc@ibmpa.awdpa.ibm.com (Marc Pawliger)
  1662.  
  1663. Marc Pawliger post an extensive list periodically to this newsgroup
  1664. about various third party hardware products for the RS/6000.  This list
  1665. can also be ftp'd from ibminet.awdpa.ibm.com.
  1666.  
  1667.  
  1668. 5.02: Disk/Tape/SCSI
  1669. From: anonymous
  1670.  
  1671. - Most SCSI disk drives work (IBM resells Maxtor, tested Wren 6&7 myself);
  1672.   use osdisk when configuring (other SCSI disk).
  1673.  
  1674. - Exabyte: Unfortunately only the ones IBM sells are working.
  1675.   A few other tape drives will work; 
  1676.   use ostape when configuring (other SCSI tape).
  1677.  
  1678. - STK 3480 "Summit": Works with Microcode Version 5.2b
  1679.  
  1680.  
  1681. From: bell@hops.larc.nasa.gov (John Bell)
  1682.                
  1683. In summary, third party tape drives work fine with the RS/6000 unless 
  1684. you want to boot from them. This is because IBM drives have 'extended 
  1685. tape marks', which IBM claims are needed because the standard marks 
  1686. between files stored on the 8mm tape are unreliable. These extended 
  1687. marks are used when building boot tapes, so when the RS/6000 boots, it 
  1688. searches for an IBM tape drive and refuses to boot without it.
  1689.  
  1690.  
  1691. From: amelcuk@gibbs.clarku.edu (Andrew Mel'cuk)
  1692.  
  1693.    The IBM DAT is cheap and works.  If you get all the patches
  1694. beforehand (U407435, U410140) and remember to buy special "Media
  1695. Recognition System" tapes (Maxell, available from APS 800.443.4461 or
  1696. IBM #21F8758) the drive can even be a pleasure to use.  You can also
  1697. flip a DIP switch on the drive to be able to use any computer grade DAT
  1698. tapes (read the hardware service manual).
  1699.  
  1700.    Other DAT drives also work.  I have tried the Archive Python (works)
  1701. and experimented extensively with the Archive TurboDAT.  The TurboDAT is
  1702. a very fast compression unit, is not finicky with tapes and doesn't
  1703. require the many patches that the IBM 7206 does.  Works fine with the
  1704. base AIX 3.2 'ost' driver.
  1705.  
  1706.  
  1707. 5.03: Memory
  1708.  
  1709. I got a flyer from Nordisk Computer Services (Portland 503-598-0111, 
  1710. Seattle 206-242-7777). Here's some sample prices:
  1711.  
  1712.       16 MB Upgrade Kit   $  990
  1713.       32 MB Upgrade Kit   $1,700
  1714.       64 MB Upgrade Kit   $3,300
  1715.  
  1716. Note that with the exception of the Model 320s, you need to add memory
  1717. in pairs.
  1718.  
  1719.  
  1720. 5.04: Others
  1721. From: anonymous
  1722.        
  1723. IBM RISC System/6000 Interface Products
  1724.  
  1725. National Instruments Corporation markets a family of instrumentation
  1726. interface products for the IBM RISC System/6000 workstation family.  The
  1727. interface family consists of three products that give the RISC
  1728. System/6000 connectivity to the standards of VMEbus, VXIbus and GPIB. 
  1729. For more information, contact National Instruments Corporation,
  1730. 512-794-0100 or 1-800-433-3488.
  1731.  
  1732.  
  1733. 5.05: C++ compilers
  1734.  
  1735. Several C++ compilers are available.  Glockenspiel and Greenhills were
  1736. amongst the first vendors.  I received e-mail that Glockenspiel may now
  1737. be part of Computer Associates.  xlC++ is available from IBM.  For gcc
  1738. enthusiats, there is g++.  Comeau Computing (718-945-0009) offers
  1739. Comeau C++ 3.0 with Templates.
  1740.  
  1741. ______________________________________________________________________________
  1742. 6.00: Miscellaneous other stuff
  1743.  
  1744. 6.01: Can I get support by email?
  1745.  
  1746. AIXServ is a service tool that allows users connected to the internet
  1747. and usenet to report problems using unix mail. AIXServ is available
  1748. at no charge, to request a copy of this package send a note with the
  1749. subject of "package" to one of the following E-Mail addresses:
  1750.  
  1751.     Internet:   aixbugs%aixserv@uunet.UU.NET
  1752.     Usenet:     uunet.UU.NET!aixserv!aixbugs
  1753.                     aixbugs@austin.ibm.com     (transactions request)
  1754.                     services@austin.ibm.com    (administrivia)
  1755.                     aasc@austin.ibm.com        (test cases under 100KB)
  1756.  
  1757. The package will be mailed electronically and will contain instructions
  1758. for using AIXServ.
  1759.  
  1760. Using AIXServ, customers have the ability to 1) open new problem reports
  1761. 2) update existing problem records 3) Request a status update on an
  1762. existing problem record. Currently this service is available to United
  1763. States customers only.
  1764.  
  1765. Thomas Braunbeck reported that German customers with ESS (extended
  1766. software service) contracts can get support by email too. They can 
  1767. obtain information by sending mail with Subject: help to 
  1768. aixcall@aixserv.mainz.ibm.de.
  1769.  
  1770. Various flavors of service offerings are available. Contact your IBM rep
  1771. for details.
  1772.  
  1773.  
  1774. 6.02: List of useful faxes
  1775.  
  1776. You can get some useful info from these faxes by dialing IBM's Faxserver
  1777. at 1-800-IBM-4FAX. 
  1778.  
  1779. document number                        Title
  1780. ---------------   -----------------------------------------------------
  1781.      1453         Recovering from LED 518 in AIX 3.2
  1782.      1454         Recovering from LED 201 in AIX 3.1 and 3.2
  1783.      1456         Recovering from LED 201 in AIX 3.2
  1784.      1457         Recovering from LED 552 in AIX 3.1 and 3.2
  1785.      1458         Recovering from LED 552 in AIX 3.2
  1786.      1461         Alternative Problem Reporting Methods
  1787.      1470         Recovering from LED 223/229, 225/229, 221/229, or 221
  1788.      1537         How to Get AIX Support
  1789.      1608         Recovering from LED 727 in AIX 3.2
  1790.      1721         Recovering from LED 553 in AIX 3.1 and 3.2
  1791.      1746         Recovering from LED 551 in AIX 3.1 and 3.2
  1792.      1755         Recovering Volume Groups
  1793.      1801         Reducing the JFS Log in AIX 3.1 or 3.2
  1794.      1802         Repairing File Systems with fsck in AIX 3.1 and 3.2
  1795.      1803         How to Take a System Dump
  1796.      1804         Setting Up a Modem With the RISC/System 6000
  1797.      1845         Using iptrace to Track Remote Print Jobs
  1798.      1867         Clearing the Queuing System
  1799.      1895         Removing/Replacing a Fixed Disk
  1800.      1896         Tape Drive Densities and Special Files
  1801.      1897         Tips on mksysb for AIX 3.2
  1802.      1909         UUCP (BNU) Helpful Information
  1803.      1910         Synchronizing Disk Names
  1804.  
  1805.  
  1806. 6.03: List of 3.2 ptfs
  1807.  
  1808. A list of the latest ptfs for 3.2 is available for ftp at
  1809. ibminet.awdpa.ibm.com.
  1810.  
  1811.  
  1812. 6.04: Some RS232 hints
  1813. From: graeme@ccu1.aukuni.ac.nz, sactoh0.SAC.CA.US!jak
  1814.  
  1815. Q: How do you connect a terminal to the RS232 tty ports when not using
  1816.    the standard IBM cable & terminal transposer?
  1817. A: 1- Connect pins 2->3, 3->2, 7->7 on the DB25's
  1818.    2- On the computer side, most of the time cross 6->20 (DSR, DTR).
  1819.       Some equipment may require connecting 6, 8, and 20 (DSR, DCD, DTR).
  1820.  
  1821. Also, pin 1 (FG) should be a bare metal wire and the cable should be
  1822. shielded with a connection all the way through. Most people don't run
  1823. pin 1 because pins 1 & 7 (SG) are jumpered on many equipment.
  1824.  
  1825. When booting from diskettes, the port speed is always 9600 baud.  If you
  1826. use SMIT to set a higher speed (38400 is nice) for normal use, remember
  1827. to reset your terminal before booting.
  1828.  
  1829. Q: How do you connect a printer to the RS232 tty ports
  1830. A: 1- Connect pins 2->3, 3->2, 7->7 on the DB25's
  1831.    2- On the computer side, loop pins 4->5 (CTS & RTS)
  1832.  
  1833.  
  1834. 6.05: VT100 key bindings for aixterm
  1835. From: haedener@iac.unibe.ch (Konrad Haedener)
  1836.  
  1837. Add this to your .Xdefaults file and start your VAX session with
  1838. 'aixterm -v -name vt100 -e telnet MYVAXHOST'
  1839.  
  1840. -----
  1841. vt100.foreground: Wheat
  1842. vt100.background: MidnightBlue
  1843. vt100.font: Rom14.500
  1844. vt100.geometry: 80x25+0+0
  1845. vt100.vt102: true
  1846. vt100.fullcursor: false
  1847. vt100.pointerColor: coral
  1848. vt100.cursorColor: gray100
  1849. vt100.translations:    <Key>F1: string(0x1b) string("OP") \n\
  1850.                        <Key>F2: string(0x1b) string("OQ") \n\
  1851.                        <Key>F3: string(0x1b) string("OR") \n\
  1852.                        <Key>F4: string(0x1b) string("OS") \n\
  1853.                        <Key>KP_0: string(0x1b) string("Op") \n\
  1854.                        <Key>KP_1: string(0x1b) string("Oq") \n\
  1855.                        <Key>KP_2: string(0x1b) string("Or") \n\
  1856.                        <Key>KP_3: string(0x1b) string("Os") \n\
  1857.                        <Key>KP_4: string(0x1b) string("Ot") \n\
  1858.                        <Key>KP_5: string(0x1b) string("Ou") \n\
  1859.                        <Key>KP_6: string(0x1b) string("Ov") \n\
  1860.                        <Key>KP_7: string(0x1b) string("Ow") \n\
  1861.                        <Key>KP_8: string(0x1b) string("Ox") \n\
  1862.                        <Key>KP_9: string(0x1b) string("Oy") \n\
  1863.                        <Key>KP_Divide: string(0x1b) string("OQ") \n\
  1864.                        <Key>KP_Multiply: string(0x1b) string("OR") \n\
  1865.                        <Key>KP_Subtract: string(0x1b) string("OS") \n\
  1866.                        <Key>KP_Add: string(0x1b) string("Om") \n\
  1867.                        <Key>KP_Enter: string(0x1b) string("OM") \n\
  1868.                        <Key>KP_Decimal: string(0x1b) string("On") \n\
  1869.                        <Key>Next: string(0x1b) string("Ol") \n\
  1870.                        <Key>Left: string(0x1b) string("OD") \n\
  1871.                        <Key>Up: string(0x1b) string("OA") \n\
  1872.                        <Key>Right: string(0x1b) string("OC") \n\
  1873.                        <Key>BackSpace : string(0x7f) \n\
  1874.                        <Key>Down: string(0x1b) string("OB")
  1875.  
  1876. You should also add
  1877.  
  1878. XENVIRONMENT=$HOME/.Xdefaults
  1879. export XENVIRONMENT
  1880.  
  1881. to your .profile.
  1882.  
  1883.  
  1884. 6.06  What publications are available for AIX and RS/6000?
  1885.  
  1886. The following are free just for the asking:
  1887.  
  1888. 1. RS/Magazine
  1889.    P.O. Box 3272
  1890.    Lowell, MA 01853-9876
  1891.    email: aknowles@expert.com (Anne Knowles, editor)
  1892.  
  1893. 2. AIXpert
  1894.    IBM Corporation
  1895.    Mail Stop 36
  1896.    472 Wheelers Farms Road
  1897.    Milford, CT 06460
  1898.    FAX: (203) 783-7669
  1899.  
  1900. 3. RiSc World
  1901.    P.O. Box 399
  1902.    Cedar Park, TX 78613
  1903.    FAX: (512) 331-3900
  1904.    Usenet: {cs.utexas.edu,execu,texbell}!pcinews!rsworld
  1905.  
  1906.  
  1907. These manuals should be available from your friendly neighborhood IBM office.
  1908.  
  1909. SC23-2204-02  Problem Solving Guide
  1910. SC23-2365-01  Performance Monitoring and Tuning Guide for AIX 3.2
  1911. SA23-2629-07  Service Request Number Cross Reference, Ver 2.2
  1912. SA23-2631-05  Diagnostic Programs: Operator Guide
  1913. SA23-2632-05  Diagnostic Programs: Service Guide
  1914. SA23-2643-01  Hardware Technical Reference: General Information
  1915. SA23-2646-01  Hardware Technical Reference: Options and Devices
  1916.  
  1917. 6.07: Some acronyms
  1918.  
  1919. BOS  - Basic Operating System
  1920. ODM  - Object Database Manager
  1921. LPP  - Licensed Program Product
  1922. SMIT - System Management Interface Tool
  1923. PTF  - Program Temporary Fix
  1924. APAR - authorized program analysis report
  1925. PRPQ - programming request for price quotation
  1926. DCR  - design change request
  1927.  
  1928. _____________________________________________________________________________
  1929. 7.00: How do I get this by mailserver or ftp?
  1930.  
  1931. Since the articles are crossposted to news.answers, any archive carrying
  1932. that newsgroup will also have these articles. In particular, try
  1933. rtfm.mit.edu in the directory pub/usenet/news.answers.  This FAQ is
  1934. archived as "aix-faq/faq/part[1-2]".
  1935.  
  1936. 7.01: Contributors
  1937.  
  1938. The following persons have contributed to this list.  If you want to
  1939. contribute anonymously, just let me know - but do tell me who you are.
  1940. I apologise if I missed out anyone.
  1941.  
  1942. Thank you all, this would definitely not be the same without _your_ input.
  1943.  
  1944. Rudy Chukran            <chukran@austin.VNET.IBM.COM>
  1945. Christopher Carlyle O'Callaghan    <asdfjkl@wam.umd.edu>
  1946. Poul-Henning Kamp        <phk@data.fls.dk>
  1947. Richard Wendland                <richard@praxis.co.uk>
  1948. Ge van Geldorp            <ge@dutlru2.tudelft.nl>
  1949. Chris Jacobsen            <jacobsen@sbhep2.phy.sunysb.edu>
  1950. Peter Jeffe            <peter@ski.austin.ibm.com>
  1951. Jean-Francois Panisset        <panisset@thunder.mcrcim.mcgill.edu>
  1952. John Cary            <cary@boulder.colorado.edu>
  1953. Vijay Debbad            <vijay@ingres.com>
  1954. Dick Karpinski            <dick@ccnext.ucsf.edu>
  1955. Konrad Haedener            <haedener@iac.unibe.ch>
  1956. Doug Sewell            <DOUG@YSUB.YSU.EDU>
  1957. David Cordes            <cordes@athos.cs.ua.edu>
  1958. Graeme Moffat            <g.moffat@aukuni.ac.nz>
  1959. Andrew Pierce            <pierce@claven.cambridge.ibm.com>
  1960. Stephen Linam            <sdl@glasnost.austin.ibm.com>
  1961. Jerome Park            <jerome%aixserv@uunet.UU.NET>
  1962. Konrad Haedener            <haedener@iacrs1.unibe.ch> 
  1963. Steve Roseman            <lusgr@chili.CC.Lehigh.Edu>
  1964. John Burton            <burton@asdsun.larc.nasa.gov>
  1965. Thierry Forveille        <FORVEILL@FRGAG51.BITNET>
  1966. Joubert Berger            <afc-tci!joubert>
  1967. Minh Tran-Le            <tranle@intellicorp.com>
  1968. Paul Amaranth            <amaranth@vela.acs.oakland.edu>
  1969. Mark Whetzel            <markw@airgun.wg.waii.com>
  1970. Daniel Packman            <pack@acd.ucar.edu>
  1971. Ken Bowman            <bowman@uiatma.atmos.uiuc.edu>
  1972. Cary E. Burnette        <kerm@mcnc.org>
  1973. Christophe Wolfhugel        <wolf@grasp1.univ-lyon1.fr>
  1974. Leonard B. Tropiano        <lenny@aixwiz.austin.ibm.com>
  1975. Bill Wohler            <wohler@sap-ag.de>
  1976. James Salter            <jsalter@ibmpa.awdpa.ibm.com>
  1977. Witold Jan Owoc            <witold@enme.ucalgary.ca>
  1978. Marc Kwiatkowski        <marc@ultra.com>
  1979. Ronald S. Woan            <woan@exeter.austin.ibm.com>
  1980. Mijan Huq            <huq@hagar.ph.utexas.edu>
  1981. Herbert van den Bergh        <hbergh@nl.oracle.com>
  1982. Michael Stefanik        <mike@bria.UUCP>
  1983. John F. Haugh            <jfh@rpp386.cactus.org>
  1984. Ed Kubaitis            <ejk@ux2.cso.uiuc.edu>
  1985. Jaime Vazquez            <jaime@austin.vnet.ibm.com>
  1986. Bjorn Engsig            <bengsig@oracle.com>
  1987. Frank Kraemer             <kraemerf@franvm3.VNET.IBM.COM>
  1988. Andreas Siegert                 <afx@muc.ibm.de>
  1989. Thomas Braunbeck                <braunbec@aixserv.mainz.ibm.de>
  1990.  
  1991. _____________________________________________________________________________
  1992. Epilogue
  1993.  
  1994. If you have any comments about this list, please mail them to me, as I
  1995. cannot guarantee to pick up posted changes.  All input should be emailed
  1996. to me at basto@cactus.org on the Internet.  You can also try using
  1997. cs.utexas.edu!mavrick!luis. 
  1998.  
  1999. I work for Computer Sciences Corp. and I am doing this on my own time.
  2000. Please do not ask me questions that should be asked to IBM. If you have 
  2001. any problems, please ask IBM or post your questions to this newsgroup.
  2002. I might respond to the latter.
  2003.  
  2004. Opinions expressed here have nothing to do with either IBM or CSC.
  2005.  
  2006. All trademarks are the property of their respective owners.
  2007. -- 
  2008. Luis Basto
  2009. Computer Sciences Corporation
  2010. Internet: basto@cactus.org
  2011. Usenet:   cs.utexas.edu!mavrick!luis
  2012.